﻿package hunterCommonlib.ui.tip {
	import flash.events.MouseEvent;
	import flash.ui.Mouse;
	import hunterCommonlib.core.HApplication;
	import hunterCommonlib.ui.Panel;
	
	/**
	* ...
	* @author Default
	*/
	public class Tip extends Panel {
		private var _followMouse:Boolean
		private var _followEffect:uint=0;
		public function Tip() {
			super();
			HApplication.application.addChild(this);
		}
		public function set followMouse(value:Boolean):void {
			if (_followMouse == value ) {
				return
			}
			_followMouse = value;
			if (_followMouse) {
				HApplication.application.stage.addEventListener(MouseEvent.MOUSE_MOVE, followHandler) 
			}else {
				HApplication.application.stage.removeEventListener(MouseEvent.MOUSE_MOVE, followHandler);
			}
		}
		public function set followEffect(value:uint):void {
			if(value){
				_followEffect = value;
			}
		}
		private function followHandler(e:MouseEvent):void {
			switch(_followEffect) {
				case 1:
				break;
				default:
				x = HApplication.application.mouseX;
				y = HApplication.application.mouseY
				break;
			}
		}
	}
	
}